

    MVPI (Magic Viewer Plugin Interface) v1.0 ( 28.02.2004)
   --------------------------------------------------------------------

     ,    , 
 Magic Viewer       .
 
 -,  MV   ,     *.dll,
      "MV_"       "Plug-ins".

 function MVPI: byte;

    MVPI (   - $10 -  1.0), 
  .
      Magic Viewer' -  
   .
    ,     -   MV.

 function GetMVPlugInfo: PluginInfo;

      (PluginInfo).
   :

         Name : ShortString;   //   .
       Author : ShortString;   //    .
      Version : ShortString;   //  -   (   )
      Comment : ShortString;   //    .
   NumFormats : Byte;          //   .

      Formats : array[1..255] of FormatInfo; // -    (FormatInfo).
                FormatInfo:
               Extensions : ShortString;   //  ,   ';'
                                           //   .  '*.JPG;*.JPEG'
                     Name : ShortString;   //  ,      ,
                                           //   '|'.
                    sName : ShortString;   //       , 
                                           //         
                                           //      .    
                                           //      ,
                                           //        
                                           //    Name.
                     iType: byte;          //  .  :
                                           //  IMAGE_TYPE    = $01;  // 
                                           //  PALETTE_TYPE  = $02;  // 
                                           //  WAVE_TYPE     = $03;  // 
                     sFlag: byte;          //  .  :
                                           //  NO_SAVE       = $00;  //     
                                                                     //  .
                                           //  SIMPLE_SAVE   = $01;  //    ( )
                                           //  ADVANCED_SAVE = $02;  //    
                                                                                                   // (  - Setup).
  , ,    (Setup)    - 
    Setup.

 procedure Setup (ParentHWND: Integer; KOLParent: Pointer; Format: Byte);

      MV     Setup.
 :
  ParentHWND -  (Handle) ,   .
  KOLParent -       Delphi KOL.
                       PControl - Applet (   ).
  Format -   (     Formats   ),
                   . 
              MV   ,     Setup   Plug-ins.
               ,       (    ).

function SaveItem (OUTDIR: ShortString; FI: FormatItem; Format: Byte): Boolean;

     - ,  
  .
 :
  OUTDIR -  .
  FI -   FormatItem.
    :
     Name: ShortString; //   .
   Handle: Pointer;     //      .      - ,
                        //           Windows PCM.
                        //        Windows Bitmap.
                        //    -      
                        //  array[0..255]of record:  R,G,B,F: Byte;
     Size: Cardinal;    //    (  -  -     1024).
    iType: Byte;        //    .  :
                        //   IMAGE_TYPE    = $01;   // 
                        //   PALETTE_TYPE  = $02;   // 
                        //   WAVE_TYPE     = $03;   // 
    Format -   (     Formats   ).

function CanRead (F: ShortString; StrongDetect: Boolean): Boolean;

Magic Viewer   ,  ,     
.    -    True.
:
    F -    
    StrongDetect -  True,       
     ( MV        ).   c,    .
  
function ReadFile (F: ShortString; Progress: TProgressCallB; Palette: Pointer): Integer;

  .      
(,   )   :
 READ_ERROR = 0;        //    /  .
 INVALID_FORMAT = -1;   //     .
:
    F -    
    Progress -   TProgressCallB = procedure (B: Byte); 
                          ,
                           0  100.
   Palette -     MV (    Current Palette).
   MV = array[0..255]of record:  R,G,B,F: Byte;
   ,         MV (!!!    
    8-  .        
  -).

function GetItem (Idx: Integer; Full: Boolean; Progress: TProgressCallB; Palette: Pointer): FormatItem;

Magic Viewer   ,       (FormatItem).
  FormatItem    SaveItem.
  :
 Idx -  ( )  ,     .
         ,     , ..  MV   
       ,   Idx = 0.
 Full - Magic Viewer      Full = FALSE   , 
      .     Full = TRUE,     
    .    ?      
   ReadFile    ,   ,   
  (, )         - 
  (   ""     )... 
    Full    ,    
 ,      ""   .

procedure CloseFile;
 
Magic Viewer   ,     / 
/      ,  .

function GetCurrentFormatInfo: CurrentFormatInfo;

     .
    CurrentFormatInfo:
           ID : ShortString;  //   - , , 'WAV'.
       Comment: ShortString;  //   ,    ,
                              //      ... 
       HavePalette: Boolean;  // ,     .
                              //   -  PALETTE_TYPE -    True.
                              //  - ,      
                              //  . ( True,       8 BPP)

procedure About (ParentHWND: Integer; KOLParent: Pointer);

  About-.
:
ParentHWND -  (Handle) ,   .
KOLParent -       Delphi KOL.
                       PControl - Applet (   ).

----------------------------------------------------------------------------------------
     magicteam@mail.ru.

   MVPI      ( 
 )  e-mail,     http://magicteam.narod.ru   .
----------------------------------------------------------------------------------------